{% extends 'base.html' %}

{% load static %}


{% block title %}
Welcome
{% endblock %}

{% block title_note %}
{% if user.is_authenticated %}
    {{user.username}}
{% endif %}
{% endblock %}

{% block main_content %}
{% if user.is_authenticated %}
<div class="row">
    <div class="col-md-12">
        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">Models</h3>
            </div>
            <div class="box-body actions">
                <ul>
                    <li>
                        <a href="{% url 'example:timesheets' %}">
                            <span class="glyphicon glyphicon-time"></span> View timesheets
                        </a>
                    </li>
                    <li>
                        <a href="{% url 'example:vacations' %}">
                            <span class="fa fa-plane"></span> View vacations
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        {% if perms.auth.no_permission %}
        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">Workflows</h3>
            </div>
            <div class="box-body actions">
                <ul>
                    <li>
                        <a href="{% url 'example:daily:start' %}">
                            <span class="glyphicon glyphicon-edit"></span> Fill a daily timesheet
                        </a>
                    </li>
                    <li>
                        <a href="{% url 'example:vacation:start' %}">
                            <span class="glyphicon glyphicon-edit"></span> Request a vacation
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        {% endif %}
        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">Tasks</h3>
            </div>
            <div class="box-body actions">
                <ul>
                    <li>
                        <a href="{% url 'example:daily:tasks' %}">
                            <span class="glyphicon glyphicon-tasks"></span> View daily timesheet related tasks
                        </a>
                    </li>
                    <li>
                        <a href="{% url 'example:vacation:tasks' %}">
                            <span class="glyphicon glyphicon-tasks"></span> View vacation request related tasks
                        </a>
                    </li>
                    <li>
                        <a href="{% url 'example:tasks_in_progress' %}">
                            <span class="glyphicon glyphicon-tasks"></span> View in progress tasks
                        </a>
                    </li>
                    <li>
                        <a href="{% url 'example:tasks_completed' %}">
                            <span class="glyphicon glyphicon-tasks"></span> View completed tasks
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
</div>

{% else %}
<div class="row">
    <div class="col-md-12">
        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">Welcome</h3>
            </div>
            <div class="box-body actions">
                <p>
                    You are not logged in :(
                </p>
                <p>
                    You can login by selecting your name from top menu
                </p>
            </div>
        </div>
    </div>
</div>
{% endif %}

{% endblock main_content %}
